<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>6_1_3-2-局部注册组件</title>
</head>

<body>


  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <div id="Application">
    <comp1></comp1>
  </div>
  <script>
    const App = Vue.createApp({});
    const comp2 = {
      template: `<div>组件2</div>`,
    };
    const comp1 = {
      components: {
        comp2: comp2,
      },
      template: `<div>组件1<comp2></comp2></div>`,
    };
    App.component("comp1", comp1);
    App.mount("#Application");
  </script>
</body>

</html>